package com.woorigil.social;

import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.net.URL;
import java.net.URLConnection;

public class HttpUtils {
	public static String getHtml(String mainUrl) {
		try {
			URL url = new URL(mainUrl);
			URLConnection connection = url.openConnection();
			BufferedReader br = new BufferedReader(new InputStreamReader(connection.getInputStream()));

			StringBuffer buf = new StringBuffer();
			while (true) {
				String line = br.readLine();
				if (line == null) {
					break;
				}
				buf.append(line);
			}
			return buf.toString();
		} catch (Exception e) {
			e.printStackTrace();
			return null;
		}
	}
}
